package util;

public class List<E>
{
	public E head;
	public List<E> tail;

	public List(E h, List<E> t)
	{
		if ( h == null )
			throw new Error();

		head = h;
		tail = t;
	}

	public int size()
	{
		if ( tail == null )
			return 1;

		return 1 + tail.size();
	}

	public E get(int i) {
		if (i==0) 
			return head;
		return tail.get(i-1);
	}

	public void set(int i, E e) {
		if (i==0){
			head = e;
			return;
		}
		tail.set(i-1,e);
	}
}
